package com.gitee.hermer.engine.jars.core.web.configuration;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import org.springframework.web.servlet.view.InternalResourceViewResolver;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.gitee.hermer.engine.jars.core.web.config.ViewProperties;
import com.gitee.hermer.engine.jars.dependent.dsm.IEnginePropertiesAware;

@Configuration
public class EngineViewAutoConfiguration extends WebMvcConfigurerAdapter implements IEnginePropertiesAware<ViewProperties>{
	
	@Bean
	public InternalResourceViewResolver internalResourceViewResolver(ViewProperties properties) {
		InternalResourceViewResolver resolver = new InternalResourceViewResolver();
		resolver.setPrefix(properties.getPrefix());
		resolver.setSuffix(properties.getSuffix());
		return resolver;
	}
	
	@Override
	public void setProperties(ViewProperties properties) { }

}
